<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #bg {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: -1;
        }
        .box{
            width: 100%;
            height: 200px;
            background: aquamarine;
            display: none;
        }
        .box img{
            float: left;
            height: 100%;
            margin-left: 40px;
        }
    </style>
</head>
<body id="body">
    
    <div id="box" class="box">
        <img src="./images/1.jpg" alt="" onclick="trigger(this)">
        <img src="./images/2.jpg" alt="" onclick="trigger(this)">
        <img src="./images/3.jpg" alt="" onclick="trigger(this)">
    </div>
    <button id="btn">更换皮肤</button>
    <div id="bg">

    </div>
    <script>
        // let imgs = box.getElementsByTagName('img');

        btn.onmouseover = () => {
            box.style.display = 'block';
        }
        
        let boxHidden = () => {
            box.style.display = 'none';
        }

        let trigger = (img) => {
            
            bg.style.backgroundImage = `url(${img.getAttribute('src')})`;
        }
    </script>
</body>
</html>